#ifndef SIMUHOST_H
#define SIMUHOST_H

#include <cstdlib>

class SimuHost {

private:
    double ipc;
    double clockSpeed; // in GHz
    unsigned int startTime;
    unsigned int currentTime;
    double timeDenom;
    bool isOn;
    bool isSleeping;
    bool hasFailed;
    unsigned int MTTF;
    unsigned int MTTR;
    unsigned int failTime;
    unsigned long long ins;
    unsigned long long load;
    unsigned long long processedLoad;

    void process();

public:
    SimuHost(unsigned int st, unsigned int ct, double td, double hs, double ic, unsigned int timeToFailure, unsigned int timeToRepair);//currentTime, timeDenom, speed, IPC
    SimuHost();
    unsigned short loadPercentage();
    bool hardwareFailed();
    bool turnOn(bool);
    bool sleep(bool);
    bool allocateLoad(unsigned long long);
    bool fix();
    bool sync(unsigned int);
    unsigned long long currentLoad();
    unsigned long long generateLoad(unsigned long long min, unsigned long long max);
};

#endif // SIMUHOST_H
